<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <link rel="stylesheet" href="../../lib/theme/style.css">
    <link rel="stylesheet" href="../../lib/css/swiper.min.css">
    <link rel="stylesheet" href="../../lib/iconfont/iconfont.css">
</head>

<body>
    <div id="app">
        <img class="logo" src="../../lib/image/tx.jpg" alt="">
        <div class="tabs">
            <span @click.stop="goto('0')" data-id="0" :class="[type==0?'on':'']">手机快捷登录</span>
            <span @click.stop="goto('1')" data-id="1" :class="[type==1?'on':'']">账号密码登录</span>
        </div>
        <div class="phoneFrom" v-if="type==0">
            <div class="loginInput">
                <input type="text" placeholder="手机号">
                <span>获取验证码</span>
            </div>
            <div class="loginInput">
                <input type="text" placeholder="验证码">
            </div>
            <div @click.stop="login" class="loginBtn">
                <button>登录</button>
            </div>
        </div>
        <div class="phoneFrom" v-else>
            <div class="loginInput">
                <input type="text" v-model="userInfo.mobile" placeholder="手机号">
                <span class="iconfont icon-roundclosefill"></span>
            </div>
            <div class="loginInput">
                <input type="text" v-model="userInfo.password" placeholder="密码">
                <span class="iconfont icon-roundclosefill"></span>
            </div>
            <div class="infos">
                <span>忘记密码</span>
                <span>立即注册</span>
            </div>
            <div class="loginBtn" @click.stop="login">
                <button>登录</button>
            </div>
        </div>
    </div>
    <script src="../../lib/js/maps.js"></script>
    <script src="../../lib/js/mui.min.js"></script>
    <script src="../../lib/js/vue.min.js"></script>
    <script src="../../lib/js/jquery.min.js"></script>
    <script src="../../lib/js/swiper.min.js"></script>
    <script src="../../lib/js/assembly.js"></script>
    <script src="../../lib/js/config.js"></script>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                type: 0,
                userInfo: {
                    mobile: '',
                    password: '',
                    phoneidentify: ''
                }
            },
            created() {
                console.log(versions)
                getLocation()
            },
            methods: {
                goto(e) {
                    console.log(e)
                    this.type = e

                },
                login() {
                    console.log(getItem('MEMBERTOKEN'))
                    console.log(this.userInfo)
                    var appType = ''
                    if (versions.android) {
                        appType = 1
                    } else if (versions.ios) {
                        appType = 2
                    }
                    var data = {
                        memberMobile: this.userInfo.mobile, //非空
                        memberPass: this.userInfo.password, //非空
                        appType: appType, //前端类型，1-android，2-iOS 非空
                        // phoneIdentify: plus.device.uuid, //手机唯一标识,
                        phoneIdentify: '1111', //手机唯一标识,
                        memberType: 2, //客户端角色，1老师  2家长，非空。家长版传2，老师版传1.

                    }
                    post('/rest/member/login', data, function(res) {
                        console.log(res)
                        setItem('USERINFO', res)
                            // mui.openWindow({
                            //     url: '/public/index/index.html',
                            //     id: 'pageindex'
                            // })
                        route('/public/index/index.html', 'pageindex')
                    })


                }
            }
        })
        mui.plusReady(function() {
            vm.userInfo.phoneIdentify = plus.device.uuid
        })
    </script>
</body>

</htm